package com.cqnu.util;

import java.util.List;


/**
 * 
 * @Filename ListUtil.java
 * 
 * @Description
 * 
 * @Version 1.0
 * 
 * @Author zuoci
 * 
 * @History <li>Author: zuoci</li> <li>Date: 2016-8-31</li> <li>Version: 1.0</li>
 *          <li>Content: create</li>
 * 
 */
public class ListUtil {

	public static String toStr(List<String> list) {
		if (list == null || list.isEmpty()) {
			return "";
		}
		StringBuilder sb = new StringBuilder();
		for (String _str : list) {
			sb.append(_str).append(SplitConstants.SEPARATOR_CHAR_COMMA);
		}
		sb.deleteCharAt(sb.length() - 1);
		return sb.toString();
	}
	
	public static String toStr(String[] list) {
		if (list == null || list.length == 0) {
			return "";
		}
		StringBuilder sb = new StringBuilder();
		for (String _str : list) {
			sb.append(_str).append(SplitConstants.SEPARATOR_CHAR_COMMA);
		}
		sb.deleteCharAt(sb.length() - 1);
		return sb.toString();
	}
	
	@SuppressWarnings("rawtypes")
	public static boolean isEmpty(List list) {
		if (null == list || list.isEmpty())
			return true;
		return false;
	}
	
	@SuppressWarnings("rawtypes")
	public static boolean isNotEmpty(List list) {
		if (null == list || list.isEmpty())
			return false;
		return true;
	}
	
}

